package com.cmc.cloud.cmclink.doc.controller.admin;

import com.cmc.cloud.cmclink.agt.api.base.resp.document.AgtBaseInfoDTO;
import com.cmc.cloud.cmclink.doc.constants.UrlConstants;
import com.cmc.cloud.cmclink.doc.rpcservice.AgreementService;
import com.cmes.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * 协议数据
 *
 * @author 申天青
 */
@Tag(name = "管理后台 - 协议数据")
@RestController
@Validated
@RequestMapping(UrlConstants.APPLICATION_URL+"/agreement")
public class AgreementController {
    @Resource
    private AgreementService agreementService;


    @Operation(summary = "根据客户编号提供全量协议基础信息")
    @GetMapping("/getAgtBaseInfoByCsmCode/{csmCode}")
    @Parameter(name = "csmCode", description = "多个可以使用,号分割")
    public CommonResult<HashMap<String, ArrayList<AgtBaseInfoDTO>>> getAgtBaseInfoByCsmCodes(@PathVariable("csmCode") @Valid String csmCodes) {
        return agreementService.getAgtBaseInfoByCsmCodes(csmCodes);
    }


}
